class Solution(object):
    def memLeak(self, memory1, memory2):
        s = 1
        while True:
            if memory1 >= memory2:
                if s <= memory1:
                    memory1 -= s
                else:
                    break
            else:
                if s <= memory2:
                    memory2 -= s
                else:
                    break
            s += 1
        return [s, memory1, memory2]